﻿#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

const double PI = 3.141592653589793;

// 生成正弦波信号
vector<double> generate_signal(double frequency, double amplitude, double sampling_rate, int samples) {
    vector<double> signal(samples);
    for (int i = 0; i < samples; ++i) {
        signal[i] = amplitude * sin(2 * PI * frequency * i / sampling_rate);
    }
    return signal;
}

// 合成多个信号
vector<double> combine_signals(const vector<vector<double>>& signals) {
    int samples = signals[0].size();
    vector<double> combined(samples, 0.0);
    for (const auto& signal : signals) {
        for (int i = 0; i < samples; ++i) {
            combined[i] += signal[i];
        }
    }
    return combined;
}